package com.example.myapplication;

import static androidx.constraintlayout.helper.widget.MotionEffect.TAG;

import androidx.annotation.Nullable;
import androidx.appcompat.app.AppCompatActivity;

import android.content.Intent;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.TextView;

public class rate_ten extends AppCompatActivity {
    TextView t;
    EditText ed;
    Button b,bb;
    double n;
    double r;


    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_rate_ten);
        t = findViewById(R.id.t);
        ed = findViewById(R.id.e);
        b=(Button)findViewById(R.id.b);
        bb=(Button)findViewById(R.id.bb);


    }


    public void Clickb(View v){
        Log.i(TAG,"myClick:b");
        Log.i(TAG,"myClick");
        Intent intent=getIntent();
        String name=intent.getStringExtra("name");
        String rate=intent.getStringExtra("rate");
        Double r=Double.parseDouble(rate);
        String f = ed.getText().toString();
        n=Double.parseDouble(f);
        Double y=r*n;
        String h=Double.toString(y);

        t.setText(name+"转化为"+h);

    }
    public void Clickc(View v){
        finish();
    }







}